package com.demo.config;

import jakarta.annotation.PostConstruct;
import jakarta.annotation.PreDestroy;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;
/**
 * <p> @Title AnnotationTest
 * <p> @Description Bean记载测试类
 *
 * @author tia.bin
 * 2023/1/5 10:45
 */
@Slf4j
@Component
public class AnnotationTest implements InitializingBean, DisposableBean {

    @PostConstruct
    public void postConstruct() {
        log.info("PPPPPostConstruct........");
    }

    @PreDestroy
    public void preDestroy() throws InterruptedException {
        log.info("PPPPPreDestroy.......");
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        log.info("IIIIIInitializingBean........");
    }

    @Override
    public void destroy() throws Exception {
        log.info("DDDDDisposable.......");
    }
}
